<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: wickr_array_t</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">wickr_array_t</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad5842105c20b42cc4b5b4ffc2a72556b"><td class="memItemLeft" align="right" valign="top">wickr_array_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__array.html#gad5842105c20b42cc4b5b4ffc2a72556b">wickr_array_new</a> (uint32_t item_count, uint8_t item_type, wickr_array_copy_func item_copy_func, wickr_array_destroy_func item_destroy_func)</td></tr>
<tr class="separator:gad5842105c20b42cc4b5b4ffc2a72556b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafe1191ce494529dbfd5240a84bcba5a2"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__array.html#gafe1191ce494529dbfd5240a84bcba5a2">wickr_array_get_item_count</a> (const wickr_array_t *array)</td></tr>
<tr class="separator:gafe1191ce494529dbfd5240a84bcba5a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3b3c15b3c6a15f52d20c678b6829ee21"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__array.html#ga3b3c15b3c6a15f52d20c678b6829ee21">wickr_array_set_item</a> (wickr_array_t *array, uint32_t index, void *item, bool copy)</td></tr>
<tr class="separator:ga3b3c15b3c6a15f52d20c678b6829ee21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3a6dd3ee6295f6230e2047584a261774"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__array.html#ga3a6dd3ee6295f6230e2047584a261774">wickr_array_fetch_item</a> (const wickr_array_t *array, uint32_t index, bool copy)</td></tr>
<tr class="separator:ga3a6dd3ee6295f6230e2047584a261774"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1e28a815bd4310985e493b67f66f26c7"><td class="memItemLeft" align="right" valign="top">wickr_array_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__array.html#ga1e28a815bd4310985e493b67f66f26c7">wickr_array_copy</a> (const wickr_array_t *array, bool deep_copy)</td></tr>
<tr class="separator:ga1e28a815bd4310985e493b67f66f26c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga984338e0a278ef1b23aca7330f0bfcc3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__array.html#ga984338e0a278ef1b23aca7330f0bfcc3">wickr_array_destroy</a> (wickr_array_t **array, bool destroy_items)</td></tr>
<tr class="separator:ga984338e0a278ef1b23aca7330f0bfcc3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga1e28a815bd4310985e493b67f66f26c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1e28a815bd4310985e493b67f66f26c7">&#9670;&nbsp;</a></span>wickr_array_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wickr_array_t* wickr_array_copy </td>
          <td>(</td>
          <td class="paramtype">const wickr_array_t *&#160;</td>
          <td class="paramname"><em>array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>deep_copy</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Make a copy</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">array</td><td>the array that is being copied </td></tr>
    <tr><td class="paramname">deep_copy</td><td>if true, items inserted into the copied array will be a deep copy of items in the original array. If false, items in the original array will be inserted into the new array without transferring ownership </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a copy of the array, or NULL if either allocating the copied array fails, or the deep_copy flag is set, and the copy operation fails on one of the items in the source array </dd></dl>

</div>
</div>
<a id="ga984338e0a278ef1b23aca7330f0bfcc3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga984338e0a278ef1b23aca7330f0bfcc3">&#9670;&nbsp;</a></span>wickr_array_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_array_destroy </td>
          <td>(</td>
          <td class="paramtype">wickr_array_t **&#160;</td>
          <td class="paramname"><em>array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>destroy_items</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Free an array</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">array</td><td>the array to destroy </td></tr>
    <tr><td class="paramname">destroy_items</td><td>if true, the destroy function specified in 'wickr_array_create' will be called on each item in the array before destroying the array itself </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga3a6dd3ee6295f6230e2047584a261774"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3a6dd3ee6295f6230e2047584a261774">&#9670;&nbsp;</a></span>wickr_array_fetch_item()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* wickr_array_fetch_item </td>
          <td>(</td>
          <td class="paramtype">const wickr_array_t *&#160;</td>
          <td class="paramname"><em>array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>copy</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Fetch an item at a specified index</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">array</td><td>the array from which an item will be fetched </td></tr>
    <tr><td class="paramname">index</td><td>the position in the array the item will be fetched from </td></tr>
    <tr><td class="paramname">copy</td><td>if true, a deep copy will be made and returned instead of the item stored in the array </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the item in the array at position 'index'. NULL is returned if the index is not within the bounds of the array, if the item at position 'index' is NULL because it was never set with 'wickr_array_set_item', or because copy was true and the copy operation failed </dd></dl>

</div>
</div>
<a id="gafe1191ce494529dbfd5240a84bcba5a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafe1191ce494529dbfd5240a84bcba5a2">&#9670;&nbsp;</a></span>wickr_array_get_item_count()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t wickr_array_get_item_count </td>
          <td>(</td>
          <td class="paramtype">const wickr_array_t *&#160;</td>
          <td class="paramname"><em>array</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Fetch the size of the array</p>
<p>Note that null values in the array, or uninitialized values in the array will still be counted. The size of the array remains static after it has been created with wickr_array_new. Increasing or decreasing the size of the array is not yet supported</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">array</td><td>an array to get the item count of </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of items contained in the array </dd></dl>

</div>
</div>
<a id="gad5842105c20b42cc4b5b4ffc2a72556b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad5842105c20b42cc4b5b4ffc2a72556b">&#9670;&nbsp;</a></span>wickr_array_new()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wickr_array_t* wickr_array_new </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>item_count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>item_type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wickr_array_copy_func&#160;</td>
          <td class="paramname"><em>item_copy_func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wickr_array_destroy_func&#160;</td>
          <td class="paramname"><em>item_destroy_func</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a new array</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">item_count</td><td>number of items the array will hold </td></tr>
    <tr><td class="paramname">item_type</td><td>an integer that will designate the type of item the array will hold. All items in the array must be of the same type </td></tr>
    <tr><td class="paramname">item_copy_func</td><td>a function that will provide a deep copy of an item in the array </td></tr>
    <tr><td class="paramname">item_destroy_func</td><td>a function that will provide freeing memory consumed by an item in the array </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated array </dd></dl>

</div>
</div>
<a id="ga3b3c15b3c6a15f52d20c678b6829ee21"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3b3c15b3c6a15f52d20c678b6829ee21">&#9670;&nbsp;</a></span>wickr_array_set_item()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wickr_array_set_item </td>
          <td>(</td>
          <td class="paramtype">wickr_array_t *&#160;</td>
          <td class="paramname"><em>array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>item</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>copy</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Assign an item to a specified index in the array</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">array</td><td>the array the item is being set into </td></tr>
    <tr><td class="paramname">index</td><td>the position in the array the item is being set into </td></tr>
    <tr><td class="paramname">item</td><td>the item that will be set in the array at the specified index </td></tr>
    <tr><td class="paramname">copy</td><td>if true, a deep copy of the item will be made, and the copy will be inserted into the array </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the index is within the bounds of the array, and item points to a valid pointer, will return false if copy is set and the copy operation fails </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
